<?php
$CPS_List  = array('');

//http://p.yiqifa.com/c?s=d4faf4cb&w=75997&c=247&i=159&l=0&e=&t= dangdang
//http://p.yiqifa.com/c?s=8a9bb352&w=75997&c=254&i=160&l=0&e=&t= 360buy
//http://p.yiqifa.com/c?s=8a9bb352&w=75997&c=254&i=160&l=0&e=&t=http://www.360buy.com/product/126075.html
//http://p.yiqifa.com/c?s=89d44471&w=75997&c=4161&i=3983&l=0&e=&t=http://www.gouxie.com/?product-3352.html

define('CPS_LINK',''); 


function GetCPSURL($URL,$CPSList){


    if(!edp_is_empty_string(CheckCPSSupport($URL,$CPSList))){

 		//如果支持cps，返回拼接的链接   	
    	return CPS_LINK.$URL;
    	
    }else{
    	
   		//否则返回原来链接	
    	return $URL;
    }	       		
}

    //是否支持cps
function CheckCPSSupport($URL,$CPSList){
		
	foreach($CPSList as $key=>$value){	
		
		if(strpos($URL,$key))
				
		 return $value;		 
	
	}
	return '';
}


?>